home *** CD-ROM | disk | FTP | other *** search
/ Softwarová Záchrana 3 / Softwarova-zachrana-3.bin / Xteq X-Setup / xqdcXSP-Setup-EN.exe / {app} / plugins / XQ IE Clear History folder.xpl < prev    next >
Text File  |  2004-04-28  |  6KB  |  177 lines

  1. "FILE"="Xteq Systems X-Setup Plugin 6.0"
  2. "TYPE"="5"
  3. "COUNT"="2"
  4. "UIPATH"="Internet\Internet Explorer\Clear"
  5. "NAME"="Clear History"
  6. "VERSION"="2.02"
  7. "OSVERSION"="00010111"
  8. "LANGUAGE"="VBScript"
  9. "TEXT 1"="Clear IE History Folder"
  10. "TEXT 2"="Clear IE History Folder (Security Wipe)"
  11. "DESCRIPTION 1"="This plug-in will totally erase any files in your Internet Explorer 'History' folder."
  12. "DESCRIPTION 2"="If you apply the second option, every file found (except a file named index.dat) will be filled with garbage before deleting so even an undelete does not show what was inside the files."
  13. "DESCRIPTION 3"="These options will not work if you have your History folder set in the registry using a variable, such as %USERPROFILE%\Local Settings\History [the %userprofile% is the variable.  Anything between two percent signs (example: %anything% ) is a variable].
  14. "DESCRIPTION 4"="To enable these options to work, you must manually specify a History folder.  There is a plug-in included with X-Setup which will allow you to set a folder path for the IE History location."
  15. "AUTHOR"="Xteq Systems (CptSiskoX)"
  16. "CONTACTURL"="http://www.xteq.com"
  17. "COPYRIGHT"="Copyright ⌐ Xteq Systems - All Rights Reserved"
  18. "COMMENT 1"="Thanks to kplew for the bug notice!"
  19.  
  20.  
  21. sP="HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders\History"
  22.  
  23. sPFRO="HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\PendingFileRenameOperations"
  24. sPFRO_Txt="\??\"
  25. iMaxIndexItems=2048
  26. iCurIndexItem=0
  27. Dim aryIndexItems()
  28.  
  29. sMsg_NotYet="We are sorry, but the PendingFileRenameOperations registry value can not be used for clearing since this value is already existing. Please restart your computer so these pending operations can be executed and start this plug-in again after that."
  30. sMsg_Done="The history information has been cleared."
  31. sMsg_Done2=" However, some file are in use by Windows so they can not be deleted right now. These files has been marked for deletion which will take place the next time this computer is restarted. Therefore, you should restart your computer as soon as possible."
  32.  
  33. Sub Plugin_Initialize 
  34. End Sub
  35.  
  36. Sub Plugin_CheckData(ElementIndex)
  37. End Sub
  38.  
  39. Sub Plugin_Apply(ElementIndex,ElementSubIndex)
  40.  ReDim aryIndexItems(iMaxIndexItems)
  41.  iCurIndexItem=0
  42.  
  43.  If RegValueExists(sPFRO) then
  44.     Call MsgError(sMsg_NotYet)
  45.  else
  46.     if ElementIndex=1 then 
  47.        Call DoWork(false)  
  48.     else
  49.        Call DoWork(true)
  50.     end if
  51.  end if
  52.  
  53. 'aAry=RegReadValue(sPath)
  54. 'i=LBound(aAry)
  55. 'msginformation cstr(i)
  56.  
  57.  'create an empty array
  58. 'Dim aryLoc()
  59. 'resize it to two value
  60. 'ReDim aryLoc(1)
  61.  
  62. 'aryLoc(0)="\??\C:\Dokumente und Einstellungen\TeX HeX\Desktop\History.IE5\ "
  63. 'aryLoc(1)="ssdsdssd"
  64. 'Now write it 
  65. 'Call RegWriteValue(sPFRO,aryLoc,5)
  66. End Sub
  67.  
  68.  
  69. Sub DoWork(EraseTotally)
  70.     s=RegReadValue(sP)
  71.     
  72.     if folderexists(s) then
  73.        i=FolderEnum(s)
  74.        if i>0 then
  75.           sBasePath=FolderEnumElement(1)
  76.           iCount=FolderEnum(sBasePath)
  77.  
  78.           for i=1 to iCount
  79.               Call KillDir(FolderEnumElement(i),EraseTotally,false)
  80.           next
  81.                    
  82.           'okay, now look for any remaing files...
  83.           Call KillDir(sBasePath,EraseTotally,false)
  84.  
  85.           'now check for index.dat files to be deleted...
  86.           iTotalCount=0
  87.           i=0
  88.           do while len(aryIndexItems(i))>0 
  89.              iTotalCount=iTotalCount+1 
  90.              i=i+1 
  91.           loop
  92.           
  93.           'msginformation "Total Count: " & iTotalCount
  94.  
  95.           if iTotalCount>0 then
  96.              Dim aryFinal()
  97.              ReDim aryFinal((iTotalCount*2)-1)
  98.  
  99.              for i=0 to iTotalCount-1
  100.                  aryFinal((i+i))=sPFRO_Txt & aryIndexItems(i)
  101.                  aryFinal((i+i)+1)=""
  102.              next
  103.  
  104.              Call RegWriteValue(sPFRO,aryFinal,5)
  105.           end if
  106.   
  107.  
  108.           'done!
  109.           if iTotalCount=0 then
  110.              Call MsgInformation(sMsg_Done)
  111.           else
  112.              Call MsgInformation(sMsg_Done & sMsg_Done2)
  113.              Call Restart()
  114.           end if
  115.  
  116.        end if
  117.     else
  118.        msgerror "Unable to locate History folder - nothing done!"
  119.     end if
  120. end Sub
  121.  
  122.  
  123. Sub KillDir(DirName,EraseTotally,KillDirAlso)
  124.  iC=FileEnum(DirName & "*.*")
  125.  
  126.  for i=1 to iC 
  127.      sFile=FileEnumElement(i)
  128.      bDoFileDel=true
  129.  
  130.      'index.dat can not be earased, always locked for writing... grr..
  131.      if lcase(right(sFile,9))="index.dat" then ' and lcase(right(DirName,11))="history.ie5" 
  132.         bDoFileDel=false
  133.         aryIndexItems(iCurIndexItem)=sFile
  134.         iCurIndexItem=iCurIndexItem+1  
  135.      end if
  136.  
  137.      'it's not required to delete desktop.ini
  138.      if lcase(right(sFile,11))="desktop.ini" then 
  139.         bDoFileDel=false
  140.      end if
  141.  
  142.  
  143.      if bDoFileDel=true then   
  144.         if EraseTotally then
  145.            lC=TxtOpen(sFile)
  146.  
  147.            'replace contents of file    
  148.            for l=1 to lC 
  149.                Call TxtSetLine(l,"-")
  150.            next
  151.          
  152.            'desktop.ini is special case..
  153.            if right(sFile,11)="desktop.ini" then
  154.               Call FileSetAttribute(sFile,"R-")
  155.               Call FileSetAttribute(sFile,"H-")
  156.               Call FileSetAttribute(sFile,"S-")
  157.            end if
  158.  
  159.           Call TxtSave()
  160.         end if
  161.  
  162.         'now kill the file
  163.         FileDelete(sFile)
  164.      end if               
  165.  
  166.  next 
  167.  
  168.  if KillDirAlso=true then
  169.     FolderDelete(DirName)
  170.  end if
  171. End Sub
  172.  
  173.  
  174. Sub Plugin_Terminate 
  175. End Sub
  176.  
  177.